package cn.source.system.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import cn.source.common.annotation.Excel;
import cn.source.common.core.domain.BaseEntity;

/**
 * 数据库恢复记录对象 db_recovery
 *
 * @author sourcebyte.vip
 * @date 2025-02-26
 */
public class DbRecovery extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 恢复任务主键
     */
    private Long id;

    /**
     * 连接名称
     */
    @Excel(name = "连接名称")
    private String connName;

    /**
     * 数据库名称
     */
    @Excel(name = "数据库名称")
    private String dbName;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /**
     * 恢复的表清单
     */
    @Excel(name = "恢复的表清单")
    private String tables;

    /**
     * 备份的日志
     */
    @Excel(name = "备份的日志")
    private String logs;

    private String errLogs;

    private Integer dbTaskId;//备份任务的id  手动备份当前值为null

    public Integer getDbTaskId() {
        return dbTaskId;
    }

    public void setDbTaskId(Integer dbTaskId) {
        this.dbTaskId = dbTaskId;
    }

    public String getErrLogs() {
        return errLogs;
    }

    public void setErrLogs(String errLogs) {
        this.errLogs = errLogs;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setConnName(String connName) {
        this.connName = connName;
    }

    public String getConnName() {
        return connName;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public String getDbName() {
        return dbName;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setTables(String tables) {
        this.tables = tables;
    }

    public String getTables() {
        return tables;
    }

    public void setLogs(String logs) {
        this.logs = logs;
    }

    public String getLogs() {
        return logs;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("connName", getConnName())
                .append("dbName", getDbName())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("tables", getTables())
                .append("logs", getLogs())
                .toString();
    }
}
